package com.etc.controller;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.etc.entity.Outpatientservicetype;
import com.etc.service.OutpatientservicetypeService;

@Controller
public class OutpatientservicetypeController {
	@Resource
	private OutpatientservicetypeService outpatientservicetypeService;
	
	/**
	 * 查询所有科室
	 * @return
	 */
	@RequestMapping(value="outpatientservicetype")
	public String selectOutpatientservicetype(Model model,HttpServletRequest request) {	
		List<Outpatientservicetype> outpatientservicetype = outpatientservicetypeService.selectOutpatientservicetype();
		model.addAttribute("list", outpatientservicetype);
		request.getSession().setAttribute("outpatientservicetype",outpatientservicetype );
		
		return "forward:/back/department-management.jsp";
	}
	
	@RequestMapping(value="countOutpatientservicetype",method=RequestMethod.GET)
	@ResponseBody
	public int selectCountOutpatientservicetype() {
		int count = outpatientservicetypeService.selectCount();
		return count;
	}

	
}
